<template>
	<view :style="item.compStyle" :class="item.compClass">
		<titleBettweenAndContent 
		:config="getTitleConfig"
		@click="click(getTitleConfig)">
			<view class="flex_column" slot="content">
				<image src="" mode="aspectFill" class="top-image"></image>
				<view class="list-item pre-hover" hover-class="hover" v-for="(item, index) in getList" :key="index" @tap.stop="click(item);">
					<image src="" mode="aspectFill" class="product-img"></image>
					<QS-P width="30rpx"></QS-P>
					<view class="flex_column_between_none flex_1">
						<text class="product-name">这是一条标题这是一条标题这是一条标题</text>
						<view class="flex_row_none_c">
							<view class="progress-box">
								<progress activeColor="#F52F50" :percent="30" />
							</view>
							<QS-P width="30rpx"></QS-P>
							<text class="sell">已售20件</text>
						</view>
						<view class="product-bot-box">
							<text class="price price-weight">￥600</text>
							<!-- <image src="/static/image/cart.png" mode="aspectFill" class="dyc-img-cart"></image> -->
						</view>
					</view>
				</view>
			</view>
		</titleBettweenAndContent>
	</view>
</template>

<script>
	import titleBettweenAndContent from '../titleBettweenAndContent/titleBettweenAndContent.vue';
	import QSSuperComponentCustomCompMixin from '../QSSuperComponentCustomCompMixin.js'
	export default {
		mixins: [QSSuperComponentCustomCompMixin({componentType:'bargainBuy-1'})],
		components: { titleBettweenAndContent },
		props: {
			item: {
				type: Object,
				default: ()=>({})
			}
		},
		computed: {
			getTitleConfig() {
				const o = this.item?.attributes?.titleConfig || {};
				
				return { fontSize: '38rpx' , ...o};
			},
			getList() {
				return this.item?.attributes?.list || [];
			}
		}
	}
</script>

<style scoped>
	.top-image{
		display: block;
		width: 100%;
		height: 200rpx;
		background-color: #F2F2F2;
	}
	
	.list-item{
		display: flex;
		flex-direction: row;
		padding: 25rpx;
	}
	
	.product-img{
		width: 220rpx;
		height: 220rpx;
		background-color: #F2F2F2;
		border-radius: 8rpx;
	}
	.product-name{
		font-size: 32rpx;
	}
	
	.product-bot-box{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
	
	.price{
		font-size: 32rpx;
		color: #F52F50;
	}
	.through-price {
		font-size: 24rpx;
		color: #BBBBBB;
		text-decoration: line-through;
	}
	
	.sell{
		font-size: 24rpx;
		color: #666666;
	}
	
	.progress-box{
		flex: 1;
		border-radius: 30px;
		overflow: hidden;
	}
</style>
